home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 November / EnigmA AMIGA RUN 02 (1995)(G.R. Edizioni)(IT)[!][issue 1995-11][Skylink CD].iso / earcd / program / gcc / ixemul-4.lha / ixemul-41.4 / include / ctype.h < prev    next >
C/C++ Source or Header  |  1994-02-23  |  2KB  |  70 lines

  1. /*
  2.  * Copyright (c) 1989 The Regents of the University of California.
  3.  * All rights reserved.
  4.  *
  5.  * Redistribution and use in source and binary forms are permitted
  6.  * provided that: (1) source distributions retain this entire copyright
  7.  * notice and comment, and (2) distributions including binaries display
  8.  * the following acknowledgement:  ``This product includes software
  9.  * developed by the University of California, Berkeley and its contributors''
  10.  * in the documentation or other materials provided with the distribution
  11.  * and in all advertising materials mentioning features or use of this
  12.  * software. Neither the name of the University nor the names of its
  13.  * contributors may be used to endorse or promote products derived
  14.  * from this software without specific prior written permission.
  15.  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
  16.  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  17.  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  18.  *
  19.  *    @(#)ctype.h    5.2 (Berkeley) 6/1/90
  20.  */
  21.  
  22.     /* is uppercase */
  23. #define    _U    0x01
  24.     /* is lowercase */
  25. #define    _L    0x02
  26.     /* is digit */
  27. #define    _N    0x04
  28.     /* is whitespace */
  29. #define    _S    0x08
  30.     /* is punctuation character */
  31. #define    _P    0x10
  32.     /* is control character */
  33. #define    _C    0x20
  34.     /* is hex letter */
  35. #define    _X    0x40
  36.     /* is blank */
  37. #define    _B    0x80
  38.  
  39. #ifdef KERNEL
  40. #ifdef __STDC__
  41. extern const char _ctype_[];
  42. #else
  43. extern char    _ctype_[];
  44. #endif
  45. #else
  46. #ifdef __STDC__
  47. extern const char *_ctype_;
  48. #else
  49. extern char    *_ctype_;
  50. #endif
  51. #endif
  52.  
  53. #define    isdigit(c)    ((_ctype_ + 1)[c] & _N)
  54. #define    islower(c)    ((_ctype_ + 1)[c] & _L)
  55. #define    isspace(c)    ((_ctype_ + 1)[c] & _S)
  56. #define    ispunct(c)    ((_ctype_ + 1)[c] & _P)
  57. #define    isupper(c)    ((_ctype_ + 1)[c] & _U)
  58. #define    isalpha(c)    ((_ctype_ + 1)[c] & (_U|_L))
  59. #define    isxdigit(c)    ((_ctype_ + 1)[c] & (_N|_X))
  60. #define    isalnum(c)    ((_ctype_ + 1)[c] & (_U|_L|_N))
  61. #define    isprint(c)    ((_ctype_ + 1)[c] & (_P|_U|_L|_N|_B))
  62. #define    isgraph(c)    ((_ctype_ + 1)[c] & (_P|_U|_L|_N))
  63. #define    iscntrl(c)    ((_ctype_ + 1)[c] & _C)
  64. #define    isascii(c)    ((unsigned)(c) <= 0177)
  65. #define isiso(c)    ((unsigned)(c) <= 0377)
  66. #define    toupper(c)    (islower(c) ? (c) - 'a' + 'A' : (c))
  67. #define    tolower(c)    (isupper(c) ? (c) - 'A' + 'a' : (c))
  68. #define    toascii(c)    ((c) & 0177)
  69. #define toiso(c)    ((c) & 0377)
  70.